package com.jiuqi.njt.util; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class BitmapHelper { public static Bitmap getBitmap(String imageUrl) { Bitmap mbBitmap = null; try { URL url = new URL(imageUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); InputStream is = conn.getInputStream(); mbBitmap = BitmapFactory.decodeStream(is); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return mbBitmap; } }